#ifndef __LOG_FILE_H__
#define __LOG_FILE_H__
#include "vz_log.h"

#define USE_RAM_AS_LOGFILE 

#ifdef USE_RAM_AS_LOGFILE

#define MAX_LOG_FILE_SIZE   (MAX_FILE_LOG_LEN + sizeof(LogHeader_t))
typedef struct LogHeader_ {
  uint32_t offset;
  uint32_t total_len; 
} LogHeader_t;

#else

#define MAX_FILE_COUNT  20
#define LOG_FILE_NAME     "log%d.dat"
#define LOG_INFO_FILE_NAME "log_info.dat"
typedef struct LogFileInfo_ {
  uint32_t file_count;
  uint32_t index;
  uint32_t file_size[MAX_FILE_COUNT];
} LogFileInfo_t;

#endif

int32_t LogFile_GetHeader();

int32_t LogFile_SyncCache(char *cache_data, int32_t cache_size);

int32_t LogFile_GetData(char *buffer, uint32_t buff_size,
                         uint32_t log_start, uint32_t log_count) ;

uint32_t LogFile_GetCount();

uint32_t LogFile_Clear();

#endif //__LOG_FILE_H__
